import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/global.css'
// import './utils/axios'

import TreeTable from 'vue-table-with-tree-grid'


import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './plugins/element.js'
Vue.use(ElementUI);

import axios from 'axios'
// import { config } from 'vue/types/umd'
// 在request拦截器中展示进度条 NProgress.start()
axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/'
// axios.defaults.baseURL='http://www.codeboy.com:9999/'
//axios请求拦截 登录授权 请求验证是否有token  需要授权的 API ，必须在请求头中使用 `Authorization` 字段提供 `token` 令牌
axios.interceptors.request.use(config =>{
  console.log(config);
  config.headers.Authorization=window.sessionStorage.getItem('token')
  return config
})


Vue.prototype.$http = axios

Vue.config.productionTip = false

Vue.component('tree-table',TreeTable)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

